package cn.tedu.spring.life;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

/**
 * @author 董代恒
 * @version 1.0
 */
public class TestLift {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext("cn.tedu.spring.life");
        //初始化完成之后bean就可以被使用了
        Lift lift = context.getBean(Lift.class);
        System.out.println("4.开发者使用阶段");
        //5.关闭Ioc容器，所有bean对象才会被销毁
        /*

                来自AnnotationConfigApplicationContext->GenericApplicationContext->AbstractApplicationContext
         */
        context.close();
    }
}
